<me:UIVKPOS  x:Class="WPFExcelReport.TVKPLAN"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"
    xmlns:UserControls="clr-namespace:ReflectionStudio.Components.UserControls;assembly=ReflectionStudio.Controls"
    xmlns:Localization="clr-namespace:Localization;assembly=Localization"
    xmlns:me="clr-namespace:WPFExcelReport"
    xmlns:ex="clr-namespace:WPFExcelReport.Controls;assembly=ExControls"
    xmlns:T="clr-namespace:WPFExcelReport;assembly=IntexBL" 
    x:Name="TV"
    Loaded="Window_Loaded"
 >
    <me:UIVKPOS.Resources>
        <CollectionViewSource   x:Key="vwMaster" />
        <ucd:Divideby10  x:Key="d10"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:TextTrimmingConverter  x:Key="trim"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
    </me:UIVKPOS.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="1*"></RowDefinition>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto"></ColumnDefinition>
        </Grid.ColumnDefinitions>
        <StackPanel  Grid.Row="0" Grid.Column="0">
            <WrapPanel > 
                <Label Content="{Binding Source={Localization:Translate Word=品号}}" HorizontalAlignment="Left" Margin="10,0,0,0" VerticalAlignment="Top"/>
                <TextBox  HorizontalAlignment="Left" Width="120" FontSize="18"
                         Text="{Binding ART,ElementName=TV}"
                         CharacterCasing="Upper"/>
                <Label Content="{Binding Source={Localization:Translate Word=色号}}" HorizontalAlignment="Left" Margin="10,0,0,0" VerticalAlignment="Top"/>
                <TextBox  HorizontalAlignment="Left" Width="40" FontSize="18"
                         Text="{Binding FARBE,ElementName=TV}"
                         CharacterCasing="Upper"/>
                <Label Content="{Binding Source={Localization:Translate Word=合同编号}}" HorizontalAlignment="Left" Margin="10,0,0,0" VerticalAlignment="Top"/>
                <TextBox  HorizontalAlignment="Left" Width="80" FontSize="18"
                         Text="{Binding AUFART,ElementName=TV}"
                         CharacterCasing="Upper"/>
                <Label Content="{Binding Source={Localization:Translate Word=销售单}}" HorizontalAlignment="Left" Margin="10,0,0,0" VerticalAlignment="Top"/>
                <TextBox  HorizontalAlignment="Left" Width="40" FontSize="18"
                         Text="{Binding KRS,ElementName=TV}"
                         CharacterCasing="Upper"/>
                <TextBox  HorizontalAlignment="Left" Width="80" FontSize="18"
                         Text="{Binding LFD,ElementName=TV}"
                         CharacterCasing="Upper"/>
                <TextBox  HorizontalAlignment="Left" Width="40" FontSize="18"
                         Text="{Binding POS,ElementName=TV}"
                         CharacterCasing="Upper"/>
                <Button Content="{Binding Source={Localization:Translate Word= 查  询 }}" Name="btnSelect" HorizontalAlignment="Left" Margin="10,0,0,0" Click="QueryCommand"/>
                <Button Content="{Binding Source={Localization:Translate Word=导出Excel}}"  HorizontalAlignment="Left" Margin="10,0,0,0" Click="btnSendToExcel_Click"/>
            </WrapPanel> 
        </StackPanel>
        <DataGrid    Grid.Row="1" Grid.Column="0"
                  VerticalAlignment="Top"  
                   AutoGenerateColumns="False"
                   EnableRowVirtualization="False"
                   IsReadOnly="True"
                   VerticalScrollBarVisibility="Auto"
                   HorizontalScrollBarVisibility="Auto"
                   HeadersVisibility="Column"     
                   ItemsSource="{Binding Source={StaticResource vwMaster}}" 
                   IsSynchronizedWithCurrentItem="True" 
                   x:Name="dlgMaster"   
                   RowDetailsVisibilityMode="Visible"  Margin="0,0,0,40">
            <DataGrid.Columns>
                <DataGridTextColumn Binding="{Binding Path=VKPKDKOMM}" Header="{Binding Source={Localization:Translate Word=合同编号}}" Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=VKKBESTSB}" Header="{Binding Source={Localization:Translate Word=合约号}}" Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=KDKUNDNA,Converter={StaticResource gb2312}}" Header="{Binding Source={Localization:Translate Word=客户}}" Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=VKPART}" Header="{Binding Source={Localization:Translate Word=工厂品号}}" Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=VKPFARBE}" Header="{Binding Source={Localization:Translate Word=色号}}" Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=VKPMENGE1,Converter={StaticResource d100}}" Header="{Binding Source={Localization:Translate Word=数量}}" Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=PC,Converter={StaticResource gb2312}}" Header="{Binding Source={Localization:Translate Word=匹长范围}}" Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=VKPZUSATZ,Converter={StaticResource gb2312}}" Header="{Binding Source={Localization:Translate Word=公差}}" Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=VKPLIEFTERM}" Header="{Binding Source={Localization:Translate Word=交期}}" Width="Auto" />  
            </DataGrid.Columns>
        </DataGrid>
    </Grid>
</me:UIVKPOS>
